package com.wx.core.process;

import java.util.Map;

/**
 * @desc 流程类管理
 * @author Gavin
 * @date 2015-7-10
 * @time 下午16:18
 * @version 1.0
 */
public class ProcessManage {
	/**
	 * 流程集合
	 */
	private Map<String, BaseProcess> processMap;

	public Map<String, BaseProcess> getProcessMap() {
		return processMap;
	}

	public void setProcessMap(Map<String, BaseProcess> processMap) {
		this.processMap = processMap;
	}

	/**
	 * 获取相应的处理流程
	 * @param type
	 * @return
	 */
	public BaseProcess getProcess(String type){
		try{
			return processMap.get(type);
		}catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	/**
	 * 
	 * <pre>
	 </pre>
	 * 
	 * @author dingyaming
	 *
	 */
	public static enum EnumProcessType {
//		text(1, "1", ,"textMessageProcess"),
		;
		private EnumProcessType(String code, String description, Class<? extends BaseProcess> clazz, String springBeanId) {
			this.code = code;
			this.description = description;
			this.clazz = clazz;
			this.springBeanId =springBeanId;
		}

		private final String code;
		private final String springBeanId;
		private final String description;
		private final Class<? extends BaseProcess> clazz;
		
		public String getCode() {
			return code;
		}

		public String getDescription() {
			return description;
		}
		
		public Class<? extends BaseProcess> getClazz() {
			return clazz;
		}

	}
}
